#!/usr/bin/gnuplot -persist
load 'graficos.gnuplot'

set xlabel "Dígitos"
set ylabel "Error relativo"

set key bottom left
set logscale y

set title  "Errores relativos de los algoritmos calculados con 20 términos y redondeo"
set output 'error-redondeo.eps'
plot[:51][:] 'gregory/digitos-redondeo.dat' using 1:(erel($2)) title "Gregory"   with lines ls 1,\
              'machin/digitos-redondeo.dat' using 1:(erel($2)) title "Machin"    with lines ls 3,\
           'ramanujan/digitos-redondeo.dat' using 1:(erel($2)) title "Ramanujan" with lines ls 5

set title  "Errores relativos de los algoritmos calculados con 20 términos y truncamiento"
set output 'error-truncamiento.eps'
plot[:51][]  'gregory/digitos-redondeo.dat' using 1:(erel($2)) title "Gregory"   with lines ls 2,\
              'machin/digitos-redondeo.dat' using 1:(erel($2)) title "Machin"    with lines ls 4,\
           'ramanujan/digitos-redondeo.dat' using 1:(erel($2)) title "Ramanujan" with lines ls 6
